Skip to content

Make the HMR WebSocket URL follow the page URL - #1218

Merged
outdooracorn merged 2 commits into
mainfrom
fix/hmr-host-detection
Sep 28, 2026
Merged

outdooracorn merged 2 commits into
mainfrom
fix/hmr-host-detection

Conversation

@addshore

@addshore addshore commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Configure devServer.client.webSocketURL as the special auto://0.0.0.0:0/ws URL to make the HMR client derive the protocol, hostname, and port from the page loaded by the browser.

This makes host-browser development connect to ws://localhost:8081/ws, while containerized browser tests (e.g. Selenium) continue to reach http://ui:8081.

Similar to #1207, this fixes the local HMR issue, but without causing CI to fail.

Validated locally:

  • Vue unit tests pass.
  • Host browser opened the webpack HMR WebSocket at ws://localhost:8081/ws.
  • Docker Compose health check and a Selenium container both received HTTP 200 from http://ui:8081.
  • End-to-end browser tests pass in a CI-like Docker Compose setup

@github-actions

Copy link
Copy Markdown

Deployment previews on netlify for branch refs/pull/1218/merge will be at the following locations (when build is done):

@addshore
addshore force-pushed the fix/hmr-host-detection branch from 4212017 to 3171658 Compare September 25, 2026 22:11
@outdooracorn outdooracorn changed the title Fix HMR for local and containerized development Make the HMR WebSocket URL follow the page URL Sep 27, 2026

@outdooracorn outdooracorn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this and submitting a PR! This works for me locally.

One clarification: this setting controls the WebSocket URL used by the browser's HMR client; it does not bind the Vue dev server to 0.0.0.0. The server's bind address is controlled by --host / devServer.host, and remains set by --host ui in docker-compose.yml.

I've added a comment to the devServer.client.webSocketURL setting and updated the PR title and description to reflect this.

@outdooracorn
outdooracorn merged commit d51b6e8 into main Sep 28, 2026
7 checks passed
@outdooracorn
outdooracorn deleted the fix/hmr-host-detection branch September 28, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants